package com.app.teadoor.bean;


import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.List;

public class WorkListBean extends BaseListBean {



    private ArrayList<WorkListData> list = new ArrayList<WorkListData>();

    public ArrayList<WorkListData> getList() {
        return list;
    }

    public void setList(ArrayList<WorkListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(WorkListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrentPage() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<WorkListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public String getEname(){
        if(getList() == null) return "";
       return getList().get(0).getEname();
    }

    public List<WorkListData.Works> getWorksList(){
        return getList().get(0).getWorks();
    }

    public List<String> getRfidList(){
        List<String> rfidList = new ArrayList<>();
        for (WorkListData.Works works : getList().get(0).getWorks()){
            rfidList.add(works.getRfid());
        }
        return rfidList;
    }
}
